<template>
  <div style="width: 100%; background-color: white">
    <div
      class="index-body"
      style="
        background-color: white;
        padding: 0 30px;

        position: relative;
        overflow: hidden;
      "
    >
      <div
        style="
          position: absolute;
          top: 30px;
          right: 30px;
          color: #666666;
          font-size: 14px;
        "
      >
        <span style="cursor: pointer" @click="$router.push('/index')">{{
          $store.state.locale == "zh-cn" ? "首页" : "Home"
        }}</span>
        >
        <span style="cursor: pointer" @click="$router.push('/dynamic')">{{
          $store.state.locale == "zh-cn" ? "多威动态" : "DO-WIN Dynamics"
        }}</span>
        >
        <span
          style="cursor: pointer"
          @click="$router.push('/dynamic?name=新闻活动')"
        >
          {{ $store.state.locale == "zh-cn" ? "新闻活动" : "News and Events" }}</span
        >
        >
        <span style="color: #000000; font-weight: bold">新闻详情</span>
      </div>
      <div style="margin-top: 60px">
        <div
          style="
            width: 100%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
          "
        >
          <div style="font-weight: bold; font-size: 22px; line-height: 47px">
            {{ info.title }}
          </div>
          <div style="margin-top: 10px; font-size: 14px">{{ info.createtime }}</div>

          <div
            style="
              margin-top: 50px;
              display: flex;
              justify-content: center;
              flex-direction: column;
              align-items: center;
            "
            v-html="info.content"
          ></div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      id: "",
      info: {},
    };
  },
  computed: {
    language() {
      return this.$store.state.locale;
    },
  },
  mounted() {
    this.id = this.$route.query.id;

    this.getData();
  },
  methods: {
    getData() {
      this.ajaxs("index/newsInfo?translate=" + this.language, {
        data: {
          id: this.id,
        },
        success: (res) => {
          this.info = res.data;

          console.log(this.info);
        },
      });
    },
  },
};
</script>
<style scoped>
@import "../../assets/css/index/index.css";
</style>
